#Remember&Apply Rotation/Undo
LMB:Remember Rotation Values for selected Objects, and then "Apply Rotation" (set to 0).**_
RMB:Restore Rotation Values.
Undo_VariableL2=Remember_selected_Objects_Rot()
bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
#END
[OnRightMouseButton!]
Restore_Objects_Rot(Undo_VariableL2)
#END